Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens navigation behavior during contest runtime / active exam states by preventing workspace context switching, adjusting side menu “return” affordances, and adding compatibility exports for the runtime navigator provider to avoid Vite dev resolution issues.
Changes:
- Added a runtime policy helper to decide when workspace navigation should be locked based on joined + exam status, with test coverage.
- Updated workspace top nav context menus to become read-only (no dropdown switching) during runtime or locked navigation states, including styling tweaks.
- Updated side menu sections to hide the “back to classroom” entry during runtime/active exam navigation and use a left-arrow overview icon in
/solve; added runtime navigator provider/compat exports.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/features/contest/domain/contestRuntimePolicy.ts | Adds shouldLockContestWorkspaceNavigation and supporting status set. |
| frontend/src/features/contest/domain/contestRuntimePolicy.test.ts | Adds tests covering the new workspace-navigation locking policy. |
| frontend/src/features/contest/contexts/ContestRuntimeNavigatorProvider.ts | Introduces provider implementation in a dedicated module. |
| frontend/src/features/contest/contexts/ContestRuntimeNavigatorContext.tsx | Re-exports provider for compatibility. |
| frontend/src/features/contest/contexts/ContestRuntimeNavigatorContext.ts | Adds .ts compatibility export for module resolution. |
| frontend/src/features/contest/components/exam/ExamNavigator.tsx | Makes overview icon customizable via overviewIcon. |
| frontend/src/features/app/components/workspace/WorkspaceTopNav.tsx | Applies runtime/read-only locking to context switch menus and click handling. |
| frontend/src/features/app/components/workspace/WorkspaceTopNav.module.scss | Adds read-only styling for locked context links. |
| frontend/src/features/app/components/SideMenuContestRuntimeSection.tsx | Uses a left-arrow overview icon for runtime navigator overview entry. |
| frontend/src/features/app/components/SideMenuContestIdleSection.tsx | Adds hideClassroomBack option to conditionally hide classroom return link. |
| frontend/src/features/app/components/SideMenu.tsx | Computes and passes hideClassroomBack based on runtime/lock policy. |
| frontend/src/features/app/components/SideMenu.scss | Extends disabled styling to also apply when aria-disabled="true". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
171
to
+179
| const { isRuntime } = useContestRuntimeMode(); | ||
| const effectiveOpenMenu = isRuntime ? null : openMenu; | ||
| const contestData = useOptionalContest(); | ||
| const contestNavigationReadOnly = | ||
| isRuntime || shouldLockContestWorkspaceNavigation(contestData?.contest); | ||
| const effectiveOpenMenu = contestNavigationReadOnly ? null : openMenu; | ||
| const toggleMenu = useCallback((kind: Exclude<MenuKind, null>) => { | ||
| if (contestNavigationReadOnly) return; | ||
| setOpenMenu((menu) => menu === kind ? null : kind); | ||
| }, [contestNavigationReadOnly]); |
Comment on lines
+123
to
+128
| it("locks workspace navigation only while a joined exam is actively running", () => { | ||
| expect( | ||
| shouldLockContestWorkspaceNavigation( | ||
| createContest({ hasJoined: true, examStatus: "in_progress" }), | ||
| ), | ||
| ).toBe(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Note